<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSystemUserAuthsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        # 用户权限
        Schema::create('system_user_auths', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('user_id')->comment('用户ID');
            $table->string('identity_type')->comment('身份类型 wechat, mini_propam');
            $table->string('identifier', 191)->nullable()->comment('身份账号如 ');
            $table->string('credential', 191)->nullable()->comment('凭证 openid 认证标识');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('system_user_auths');
    }
}
